<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<%@ taglib prefix="fn"
           uri="http://java.sun.com/jsp/jstl/functions" %>
<%@ page language="java" contentType="text/html; charset=UTF-8"
         pageEncoding="UTF-8" %>
<%@page isELIgnored="false" %>

<!doctype html>
<html class="no-js">
<jsp:include page="templ/header.jsp"/>

<head>

    <title>领航榜单</title>
</head>
<body>

<jsp:include page="templ/nav.jsp"/>

<div class="index-content">
    <c:forEach items="${cateRankMap}" var="entity" varStatus="vs">
        <div class="am-g am-container newatype">

            <div
                    class="star am-container mcenter">
                    <span style="font-size: 180%;">
                        <img src="${base_static}/images/star.png"><a
                            href="${domain_name}/category/${entity.key._id}">${entity.key.name}</a>
                    </span>
            </div>

            <c:set var="flag" value="true"/>

            <c:forEach items="${entity.value}" var="siteEntity" varStatus="sn">
                <c:if test="${flag}">
                    <div class="am-u-sm-12 am-u-md-12 am-u-lg-4 oh" style="float: left;">
                        <div data-am-widget="titlebar" class="am-titlebar am-titlebar-default"
                             style="border-bottom: 0px; margin-bottom: -10px; margin-top:0;">
                            <h2 class="am-titlebar-title ">
                                    ${siteEntity.key.name}
                            </h2>
                            <nav class="am-titlebar-nav"><%--
                                    <a href="#more">more &raquo;</a>--%>
                            </nav>
                        </div>
                        <div data-am-widget="list_news"
                             class="am-list-news am-list-news-default news">
                            <div class="am-list-news-bd">
                                <ul class="am-list">
                                    <c:set var="rank_flag" value="true"/>

                                    <c:forEach items="${siteEntity.value}" var="rank"
                                               varStatus="rankStatus">

                                        <c:if test="${rank_flag}">
                                            <li class="am-g am-list-item-desced am-list-item-thumbed am-list-item-thumb-left"
                                                style="padding-top:
                                        0.5rem; padding-bottom: 0.5rem;">

                                                <div class=" am-u-sm-13 am-list-main">
                                                    <h6 class="am-list-item-hd" style="overflow: hidden;
                                            display: inline" title="${rank.desc}">
                                                        <c:set var="max_index" value="${rank.desc.length() >
                                                 19? 19 : rank.desc.length() - 1}"/>
                                                        <c:if test="${rank.isHas_content() != null &&
                                                        rank.isHas_content()}">
                                                            <a href="${domain_name}/ranking/${rank._id}"
                                                               target="_blank">${rankStatus.index + 1}.
                                                                &nbsp;
                                                                    ${rank.desc.substring(0,
                                                                            max_index + 1)}
                                                            </a>
                                                        </c:if>
                                                        <c:if test="${rank.isHas_content() == null ||
                                                        !rank.isHas_content()}">
                                                            <a href="${rank.url}"
                                                               target="_blank">${rankStatus.index + 1}.
                                                                &nbsp;
                                                                    ${rank.desc.substring(0,
                                                                            max_index + 1)}
                                                            </a>
                                                        </c:if>
                                                    </h6>
                                                </div>

                                            </li>
                                        </c:if>
                                        <c:if test="${rankStatus.index eq 9}"> <c:set
                                                var="rank_flag"
                                                value="false"/></c:if>
                                    </c:forEach>

                                </ul>
                            </div>
                        </div>
                    </div>
                </c:if>
                <c:if test="${sn.index eq 2}"> <c:set var="flag" value="false"/>
                </c:if>
            </c:forEach>

        </div>
    </c:forEach>

</div>
<jsp:include page="templ/footer.jsp"/>

</body>
</html>
